////////////////////////////////////////////////////////////////////////////////
// Filename: polygon.hpp
////////////////////////////////////////////////////////////////////////////////
#ifndef POLYGON_HPP_
#define POLYGON_HPP_

//////////////
// INCLUDES //
//////////////
#include <d3d11.h>
#include "graphics.hpp"
#include "vertextypes.hpp"
#include "../../util/math/vector2d.hpp"
#include "color.hpp"
#include "irenderble.hpp"

////////////////////////////////////////////////////////////////////////////////
// Class name: Polygon
////////////////////////////////////////////////////////////////////////////////
namespace miv {
	class Polygon : public IRenderble {
	public:
		Polygon();
		~Polygon();

		bool Initialize(Vector2D**, unsigned long*, int, int, D3DXVECTOR4, ID3D11Device*);
		void Shutdown();
		void Draw(Graphics* graphics);
		void SetActive(ID3D11DeviceContext*);

		int GetVertexCount();
		int GetIndexCount();

	private:
		bool InitializeBuffers(D3DXVECTOR4, ID3D11Device*);
		void ShutdownBuffers();
		void DrawBuffers(Graphics* graphics);

	private:
		ID3D11Buffer* m_vertexBuffer;
		ID3D11Buffer* m_indexBuffer;
		int m_vertexCount, m_indexCount;
		Vector2D** m_vertices;
		unsigned long* m_indices;
	};
}

#endif
